<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://"
      + request.getServerName() + ":" + request.getServerPort()
      + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <base href="<%=basePath%>" /> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>客户端</title>
    <script src="js/jquery-1.11.2.min.js"></script>
   
</head>

<body>
   <div>
       客户端测试页面
   </div>
    <script type="text/javascript">
    $(function() {    	
    	obj =setInterval(timer,1000);
    	
    	function timer(){
    		$.ajax({
                type: "POST",
                url: "serverController/message",
                data: {
                    type: 0
                },
                success: function(data) {
                    console.log(data);
                    var d=eval('(' + data + ')');
                    console.log(d.flag);
                    if(d.flag==1){
                    	window.location.href="mainView/student/destination.jsp"
                    }
                }
            });
    		
    		
    	}
        		        		
    })
    </script>
</body>

</html>
